/*!
 * SPDX-License-Identifier: Apache-2.0
 *
 * The OpenSearch Contributors require contributions made to
 * this file be licensed under the Apache-2.0 license or a
 * compatible open source license.
 *
 * Modifications Copyright OpenSearch Contributors. See
 * GitHub history for details.
 */

// This extra import allows any variables that are created via functions to work when loaded into JS
@import '../functions/index';

// These colors stay the same no matter the theme
$ouiColorGhost: #FCFEFF !default;
$ouiColorInk: #0A121A !default;

// Core
$ouiColorPrimary: #07827E !default;
$ouiColorSecondary: #017D73 !default;
$ouiColorAccent: #DD0A73 !default;

// Status
$ouiColorSuccess: $ouiColorSecondary !default;
$ouiColorWarning: #F5A700 !default;
$ouiColorDanger: #BD271E !default;

// Grays
$ouiColorEmptyShade: #FCFEFF !default;
$ouiColorLightestShade: #E3E5E8 !default;
$ouiColorLightShade: #D6D9DD !default;
$ouiColorMediumShade: #ADB4BA !default;
$ouiColorDarkShade: #5A6875 !default;
$ouiColorDarkestShade: #2A3947 !default;
$ouiColorFullShade: #0A1219 !default;

// Backgrounds
$ouiPageBackgroundColor: #F0F2F4 !default;
$ouiColorHighlight: #FFFCDD !default;

// Every color below must be based mathematically on the set above and in a particular order.
$ouiTextColor: $ouiColorDarkestShade !default;
$ouiTitleColor: shade($ouiTextColor, 50%) !default;
$ouiTextSubduedColor: makeHighContrastColor($ouiColorMediumShade) !default;
$ouiColorDisabled: tint($ouiTextColor, 70%) !default;

// Contrasty text variants
$ouiColorPrimaryText: makeHighContrastColor($ouiColorPrimary) !default;
$ouiColorSecondaryText: makeHighContrastColor($ouiColorSecondary) !default;
$ouiColorAccentText: makeHighContrastColor($ouiColorAccent) !default;
$ouiColorWarningText: makeHighContrastColor($ouiColorWarning) !default;
$ouiColorDangerText: makeHighContrastColor($ouiColorDanger) !default;
$ouiColorDisabledText: makeDisabledContrastColor($ouiColorDisabled) !default;
$ouiColorSuccessText: $ouiColorSecondaryText !default;
$ouiLinkColor: $ouiColorPrimaryText !default;

// Visualization colors

// Maps allow for easier JSON usage
// Use map_merge($ouiColorVisColors, $yourMap) to change individual colors after importing ths file
// The `behindText` variant is a direct copy of the hex output by the JS ouiPaletteColorBlindBehindText() function
$ouiPaletteColorBlind: (
  ouiColorVis0: (graphic: #54B399,
    behindText: #6DCCB1,
  ),
  ouiColorVis1: (graphic: #6092C0,
    behindText: #79AAD9,
  ),
  ouiColorVis2: (graphic: #D36086,
    behindText: #EE789D,
  ),
  ouiColorVis3: (graphic: #9170B8,
    behindText: #A987D1,
  ),
  ouiColorVis4: (graphic: #CA8EAE,
    behindText: #E4A6C7,
  ),
  ouiColorVis5: (graphic: #D6BF57,
    behindText: #F1D86F,
  ),
  ouiColorVis6: (graphic: #B9A888,
    behindText: #D2C0A0,
  ),
  ouiColorVis7: (graphic: #DA8B45,
    behindText: #F5A35C,
  ),
  ouiColorVis8: (graphic: #AA6556,
    behindText: #C47C6C,
  ),
  ouiColorVis9: (graphic: #E7664C,
    behindText: #FF7E62,
  ),
  ouiColorVis10: (graphic: #9C9DA0,
    behindText: #9C9DA0,
  ),
  ouiColorVis11: (graphic: #D74987,
    behindText: #D74987,
  ),
  ouiColorVis12: (graphic: #0D70CA,
    behindText: #0D70CA,
  ),
  ouiColorVis13: (graphic: #0C8967,
    behindText: #0C8967,
  ),
  ouiColorVis14: (graphic: #6E28C3,
    behindText: #6E28C3,
  ),
  ouiColorVis15: (graphic: #D76813,
    behindText: #D76813,
  )) !default;

$ouiPaletteColorBlindKeys: map-keys($ouiPaletteColorBlind
);

$ouiColorVis0: map-get(map-get($ouiPaletteColorBlind, 'ouiColorVis0'), 'graphic') !default;
$ouiColorVis1: map-get(map-get($ouiPaletteColorBlind, 'ouiColorVis1'), 'graphic') !default;
$ouiColorVis2: map-get(map-get($ouiPaletteColorBlind, 'ouiColorVis2'), 'graphic') !default;
$ouiColorVis3: map-get(map-get($ouiPaletteColorBlind, 'ouiColorVis3'), 'graphic') !default;
$ouiColorVis4: map-get(map-get($ouiPaletteColorBlind, 'ouiColorVis4'), 'graphic') !default;
$ouiColorVis5: map-get(map-get($ouiPaletteColorBlind, 'ouiColorVis5'), 'graphic') !default;
$ouiColorVis6: map-get(map-get($ouiPaletteColorBlind, 'ouiColorVis6'), 'graphic') !default;
$ouiColorVis7: map-get(map-get($ouiPaletteColorBlind, 'ouiColorVis7'), 'graphic') !default;
$ouiColorVis8: map-get(map-get($ouiPaletteColorBlind, 'ouiColorVis8'), 'graphic') !default;
$ouiColorVis9: map-get(map-get($ouiPaletteColorBlind, 'ouiColorVis9'), 'graphic') !default;
$ouiColorVis10: map-get(map-get($ouiPaletteColorBlind, 'ouiColorVis10'), 'graphic') !default;
$ouiColorVis11: map-get(map-get($ouiPaletteColorBlind, 'ouiColorVis11'), 'graphic') !default;
$ouiColorVis12: map-get(map-get($ouiPaletteColorBlind, 'ouiColorVis12'), 'graphic') !default;
$ouiColorVis13: map-get(map-get($ouiPaletteColorBlind, 'ouiColorVis13'), 'graphic') !default;
$ouiColorVis14: map-get(map-get($ouiPaletteColorBlind, 'ouiColorVis14'), 'graphic') !default;
$ouiColorVis15: map-get(map-get($ouiPaletteColorBlind, 'ouiColorVis15'), 'graphic') !default;

// sass-lint:disable-block variable-name-format
$ouiColorVis0_behindText: map-get(map-get($ouiPaletteColorBlind, 'ouiColorVis0'), 'behindText') !default;
$ouiColorVis1_behindText: map-get(map-get($ouiPaletteColorBlind, 'ouiColorVis1'), 'behindText') !default;
$ouiColorVis2_behindText: map-get(map-get($ouiPaletteColorBlind, 'ouiColorVis2'), 'behindText') !default;
$ouiColorVis3_behindText: map-get(map-get($ouiPaletteColorBlind, 'ouiColorVis3'), 'behindText') !default;
$ouiColorVis4_behindText: map-get(map-get($ouiPaletteColorBlind, 'ouiColorVis4'), 'behindText') !default;
$ouiColorVis5_behindText: map-get(map-get($ouiPaletteColorBlind, 'ouiColorVis5'), 'behindText') !default;
$ouiColorVis6_behindText: map-get(map-get($ouiPaletteColorBlind, 'ouiColorVis6'), 'behindText') !default;
$ouiColorVis7_behindText: map-get(map-get($ouiPaletteColorBlind, 'ouiColorVis7'), 'behindText') !default;
$ouiColorVis8_behindText: map-get(map-get($ouiPaletteColorBlind, 'ouiColorVis8'), 'behindText') !default;
$ouiColorVis9_behindText: map-get(map-get($ouiPaletteColorBlind, 'ouiColorVis9'), 'behindText') !default;
$ouiColorVis10_behindText: map-get(map-get($ouiPaletteColorBlind, 'ouiColorVis10'), 'behindText') !default;
$ouiColorVis11_behindText: map-get(map-get($ouiPaletteColorBlind, 'ouiColorVis11'), 'behindText') !default;
$ouiColorVis12_behindText: map-get(map-get($ouiPaletteColorBlind, 'ouiColorVis12'), 'behindText') !default;
$ouiColorVis13_behindText: map-get(map-get($ouiPaletteColorBlind, 'ouiColorVis13'), 'behindText') !default;
$ouiColorVis14_behindText: map-get(map-get($ouiPaletteColorBlind, 'ouiColorVis14'), 'behindText') !default;
$ouiColorVis15_behindText: map-get(map-get($ouiPaletteColorBlind, 'ouiColorVis15'), 'behindText') !default;

// Charts
$ouiColorChartLines: shade($ouiColorLightestShade, 3%) !default;
$ouiColorChartBand: $ouiColorLightestShade !default;

// Code
$ouiCodeBlockBackgroundColor: $ouiColorLightestShade !default;
$ouiCodeBlockColor: makeHighContrastColor($ouiTextColor, $ouiCodeBlockBackgroundColor) !default;
$ouiCodeBlockSelectedBackgroundColor: inherit !default;
$ouiCodeBlockCommentColor: $ouiColorVis10 !default;
$ouiCodeBlockSelectorTagColor: inherit !default;
$ouiCodeBlockStringColor: $ouiColorVis11 !default;
$ouiCodeBlockTagColor: makeHighContrastColor($ouiColorVis1, $ouiCodeBlockBackgroundColor) !default;
$ouiCodeBlockNameColor: $ouiColorVis12 !default;
$ouiCodeBlockNumberColor: $ouiColorVis13 !default;
$ouiCodeBlockKeywordColor: $ouiColorVis14 !default;
$ouiCodeBlockFunctionTitleColor: inherit !default;
$ouiCodeBlockTypeColor: $ouiColorVis12 !default;
$ouiCodeBlockAttributeColor: inherit !default;
$ouiCodeBlockSymbolColor: makeHighContrastColor($ouiColorVis9, $ouiCodeBlockBackgroundColor) !default;
$ouiCodeBlockParamsColor: inherit !default;
$ouiCodeBlockMetaColor: makeHighContrastColor($ouiTextSubduedColor, $ouiCodeBlockBackgroundColor) !default;
$ouiCodeBlockTitleColor: $ouiColorVis15 !default;
$ouiCodeBlockSectionColor: makeHighContrastColor($ouiColorVis9, $ouiCodeBlockBackgroundColor) !default;
$ouiCodeBlockAdditionColor: makeHighContrastColor($ouiColorVis0, $ouiCodeBlockBackgroundColor) !default;
$ouiCodeBlockDeletionColor: makeHighContrastColor($ouiColorDanger, $ouiCodeBlockBackgroundColor) !default;
$ouiCodeBlockSelectorClassColor: inherit !default;
$ouiCodeBlockSelectorIdColor: inherit !default;


/* OUI -> EUI Aliases */
$euiColorGhost: $ouiColorGhost;
$euiColorInk: $ouiColorInk;
$euiColorPrimary: $ouiColorPrimary;
$euiColorSecondary: $ouiColorSecondary;
$euiColorAccent: $ouiColorAccent;
$euiColorSuccess: $ouiColorSuccess;
$euiColorWarning: $ouiColorWarning;
$euiColorDanger: $ouiColorDanger;
$euiColorEmptyShade: $ouiColorEmptyShade;
$euiColorLightestShade: $ouiColorLightestShade;
$euiColorLightShade: $ouiColorLightShade;
$euiColorMediumShade: $ouiColorMediumShade;
$euiColorDarkShade: $ouiColorDarkShade;
$euiColorDarkestShade: $ouiColorDarkestShade;
$euiColorFullShade: $ouiColorFullShade;
$euiPageBackgroundColor: $ouiPageBackgroundColor;
$euiColorHighlight: $ouiColorHighlight;
$euiTextColor: $ouiTextColor;
$euiTitleColor: $ouiTitleColor;
$euiTextSubduedColor: $ouiTextSubduedColor;
$euiColorDisabled: $ouiColorDisabled;
$euiColorPrimaryText: $ouiColorPrimaryText;
$euiColorSecondaryText: $ouiColorSecondaryText;
$euiColorAccentText: $ouiColorAccentText;
$euiColorWarningText: $ouiColorWarningText;
$euiColorDangerText: $ouiColorDangerText;
$euiColorDisabledText: $ouiColorDisabledText;
$euiColorSuccessText: $ouiColorSuccessText;
$euiLinkColor: $ouiLinkColor;
$euiPaletteColorBlind: (
  euiColorVis0: (graphic: #54B399,
    behindText: #6DCCB1,
  ),
  euiColorVis1: (graphic: #6092C0,
    behindText: #79AAD9,
  ),
  euiColorVis2: (graphic: #D36086,
    behindText: #EE789D,
  ),
  euiColorVis3: (graphic: #9170B8,
    behindText: #A987D1,
  ),
  euiColorVis4: (graphic: #CA8EAE,
    behindText: #E4A6C7,
  ),
  euiColorVis5: (graphic: #D6BF57,
    behindText: #F1D86F,
  ),
  euiColorVis6: (graphic: #B9A888,
    behindText: #D2C0A0,
  ),
  euiColorVis7: (graphic: #DA8B45,
    behindText: #F5A35C,
  ),
  euiColorVis8: (graphic: #AA6556,
    behindText: #C47C6C,
  ),
  euiColorVis9: (graphic: #E7664C,
    behindText: #FF7E62,
  )) !default;
$euiPaletteColorBlindKeys: map-keys($euiPaletteColorBlind
);
$euiColorVis0: $ouiColorVis0;
$euiColorVis1: $ouiColorVis1;
$euiColorVis2: $ouiColorVis2;
$euiColorVis3: $ouiColorVis3;
$euiColorVis4: $ouiColorVis4;
$euiColorVis5: $ouiColorVis5;
$euiColorVis6: $ouiColorVis6;
$euiColorVis7: $ouiColorVis7;
$euiColorVis8: $ouiColorVis8;
$euiColorVis9: $ouiColorVis9;
$euiColorVis0_behindText: $ouiColorVis0_behindText;
$euiColorVis1_behindText: $ouiColorVis1_behindText;
$euiColorVis2_behindText: $ouiColorVis2_behindText;
$euiColorVis3_behindText: $ouiColorVis3_behindText;
$euiColorVis4_behindText: $ouiColorVis4_behindText;
$euiColorVis5_behindText: $ouiColorVis5_behindText;
$euiColorVis6_behindText: $ouiColorVis6_behindText;
$euiColorVis7_behindText: $ouiColorVis7_behindText;
$euiColorVis8_behindText: $ouiColorVis8_behindText;
$euiColorVis9_behindText: $ouiColorVis9_behindText;
$euiColorChartLines: $ouiColorChartLines;
$euiColorChartBand: $ouiColorChartBand;
$euiCodeBlockBackgroundColor: $ouiCodeBlockBackgroundColor;
$euiCodeBlockColor: $ouiCodeBlockColor;
$euiCodeBlockSelectedBackgroundColor: $ouiCodeBlockSelectedBackgroundColor;
$euiCodeBlockCommentColor: $ouiCodeBlockCommentColor;
$euiCodeBlockSelectorTagColor: $ouiCodeBlockSelectorTagColor;
$euiCodeBlockStringColor: $ouiCodeBlockStringColor;
$euiCodeBlockTagColor: $ouiCodeBlockTagColor;
$euiCodeBlockNameColor: $ouiCodeBlockNameColor;
$euiCodeBlockNumberColor: $ouiCodeBlockNumberColor;
$euiCodeBlockKeywordColor: $ouiCodeBlockKeywordColor;
$euiCodeBlockFunctionTitleColor: $ouiCodeBlockFunctionTitleColor;
$euiCodeBlockTypeColor: $ouiCodeBlockTypeColor;
$euiCodeBlockAttributeColor: $ouiCodeBlockAttributeColor;
$euiCodeBlockSymbolColor: $ouiCodeBlockSymbolColor;
$euiCodeBlockParamsColor: $ouiCodeBlockParamsColor;
$euiCodeBlockMetaColor: $ouiCodeBlockMetaColor;
$euiCodeBlockTitleColor: $ouiCodeBlockTitleColor;
$euiCodeBlockSectionColor: $ouiCodeBlockSectionColor;
$euiCodeBlockAdditionColor: $ouiCodeBlockAdditionColor;
$euiCodeBlockDeletionColor: $ouiCodeBlockDeletionColor;
$euiCodeBlockSelectorClassColor: $ouiCodeBlockSelectorClassColor;
$euiCodeBlockSelectorIdColor: $ouiCodeBlockSelectorIdColor;
/* End of Aliases */